#include <QApplication>
#include <QMainWindow>
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <QVBoxLayout>
#include <QWidget>
#include <QWidget>
#include <QLabel>
#include <QHBoxLayout>
#include <QPixmap>
#include <QDebug>
typedef unsigned long myuint;
typedef struct PDU
{
    myuint PDULength;
    myuint MessageType;
    myuint Status;
    char caData[128];
    char tagInfo[128];
    myuint MsgLength;
    int msgData[];
}PDU;
PDU *get_PDU(myuint length){
    // length+=128;
    myuint AllLength=sizeof(PDU)+length;
    PDU *SGdata=(PDU*)malloc(AllLength);
    memset(SGdata,0,AllLength);
    SGdata->PDULength=AllLength;
    SGdata->MsgLength=length;
    return SGdata;
}





































































































int main(int argc, char* argv[]) {
    QApplication a(argc, argv);
    QString inf="你好世界哈哈哈实时";
    PDU* s=get_PDU(inf.toUtf8().toStdString().length());
    memcpy((char*)s+sizeof(PDU),
           inf.toUtf8().toStdString().c_str(),
           inf.toUtf8().toStdString().length());
    char *cc=new char[100000000]{'\0'};

    memcpy(cc,(char*)s+sizeof(PDU),s->MsgLength);
    QString u=QString(cc);
    delete[] cc;
    qDebug()<<u;
    return a.exec();
}
